<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="../headinclude.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<jsp:include page="../include.jsp"></jsp:include>
<script src="js/role.js" type="text/javascript"></script>
<style type="text/css">
.TDHead {
    background-color:#add2da;
    border:1px solid #c0c0c0;
    font-weight:bold;
    color:#333;
    padding-left:4px;
}
/**/
.TDList {
    background-color:#fff;
    border:1px solid #c0c0c0;
    height:26px;
    color:#333;
    padding-left:9px;
}
/**/
.ListTable {
    vertical-align:top;
    border-left:1px solid #7CB5E2;
    border-bottom:1px solid #7CB5E2;
    border-right:1px solid #7CB5E2;
   }
   
</style>
<script type="text/javascript">
</script>
</head>
<body>
<div style="margin: -6px 0px 0 -8px; min-width: 650px; width: 100%;min-height: 400px;height: 100%;">
  <div style="width: 100%;float: left;min-width: 727px;"> 
     
    <div>
	 	<div style="width:100%;height:30px; background-image:url('images/main_28.gif'); background-repeat: repeat-x;"> </div>
	    <div style=" margin:-22px 0px 16px 22px; width:200px;height:14px; background:url('images/tb.gif') no-repeat;">
	    <span style="padding-left:30px; color: #E1E2E3; font-size: 12px;">角色基本信息表</span>
	    </div>
	    
	    <div style="float:right; margin:-28px 80px 0px 0px; width:300px;height:14px;">
		     <div style="float:right; padding-right:8px; background:url('images/del.gif') no-repeat;"><a style="padding-left:16px; color: #E1E2E3; font-size: 12px;cursor: pointer;" id="role-batch-del">删除</a></div>
		     <div style="float:right; padding-right:8px; background:url('images/add.gif') no-repeat;"><a style="padding-left:16px; color: #E1E2E3; font-size: 12px;cursor: pointer;" id="role-add">新增</a></div>
	    </div>
   </div>

     
  <c:if test="${empty roleList}">
     <div>没有相应数据</div>
  </c:if>
  <c:if test="${not empty roleList}">
	  <table cellpadding="0" border="0" cellspacing="0" width="100%" style="margin-top: -3px;">
	       <tr>
	          <th class="TDHead" width="30px"><input type="checkbox" id="role-select-object"/> </th>
	          <th class="TDHead">名称</th>
	          <th class="TDHead">创建时间</th>
	          <th class="TDHead">权限信息</th>
	          <th class="TDHead">基本操作</th>
	       </tr>
	     <c:forEach items="${roleList}" var="role">
	        <tr>
	          <td class="TDList"><input type="checkbox" name="role_${role.id}" value="${role.id}"/></td>
		      <td class="TDList">${role.name}</td>
		      <td class="TDList">${role.createTime}</td>
		      <td class="TDList">
		          <c:forEach items="${role.privileges}" var="privilege" varStatus="count">
		               <c:if test="${count.index eq fn:length(role.privileges)-1}">
		                  ${privilege.name}
		               </c:if>
		               <c:if test="${count.index ne fn:length(role.privileges)-1}">
		                  ${privilege.name},
		               </c:if>
		          </c:forEach>
		      </td>
		      <td class="TDList">
			      <a href="javascript:;" onclick="roleOneDel(${role.id})">删除</a>|
			      <a href="role!showSet.action?id=${role.id}">修改</a>|
		      </td>
		    </tr>
	    </c:forEach>
	  </table>
	 <jsp:include page="../page.jsp?loc=role!show.action&page=${page.currentPage}&pageSize=${page.pageSize}&total=${page.totalRows}"></jsp:include>
   </c:if>
   <div id="roleDelDiv" style="display: none;"></div>
  </div>
</div>
</html>
